Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: rework debounce function #107

Merged
merged 3 commits into from
Jan 26, 2025
Merged

feat!: rework debounce function #107

merged 3 commits into from
Jan 26, 2025

Conversation

aleclarson
Copy link
Member

@aleclarson aleclarson commented Jul 13, 2024

Tip

The owner of this PR can publish a preview release by commenting /publish in this PR. Afterwards, anyone can try it out by running pnpm add radashi@pr<PR_NUMBER>.

Summary

  • Continue debouncing (in future calls) after cancel is called. Previously, cancel would disable debouncing, so future calls would be immediate.
  • Do not have flush call the underlying function if no call is pending.
  • Expose a reference to the underlying function with the new callee property.

Related issue, if any:

Resolves #105

Resolves sodiray/radash#362

For any code change,

  • Related documentation has been updated, if needed
  • Related tests have been added or updated, if needed

Does this PR introduce a breaking change?

Yes

Bundle impact

Status File Size 1 Difference
M src/curry/debounce.ts 257 +9 (+4%)

Footnotes

  1. Function size includes the import dependencies of the function.

@aleclarson aleclarson force-pushed the feat/debounce-handler branch from d3f076c to 1de9de9 Compare July 13, 2024 03:45
@aleclarson aleclarson added the BREAKING CHANGE Not backwards compatible label Jul 13, 2024
@aleclarson aleclarson force-pushed the feat/debounce-handler branch 2 times, most recently from b100467 to 586b258 Compare July 13, 2024 23:51
@aleclarson aleclarson changed the title feat: various debounce improvements (DO NOT SQUASH) feat!: various debounce improvements (DO NOT SQUASH) Jul 14, 2024
src/curry/debounce.ts Outdated Show resolved Hide resolved
@aleclarson aleclarson force-pushed the feat/debounce-handler branch from b18ca32 to 68fc60e Compare January 26, 2025 01:39
@aleclarson aleclarson changed the title feat!: various debounce improvements (DO NOT SQUASH) feat!: rework debounce functoin Jan 26, 2025
@aleclarson aleclarson changed the title feat!: rework debounce functoin feat!: rework debounce function Jan 26, 2025
@aleclarson aleclarson merged commit 23c4b4b into next Jan 26, 2025
10 checks passed
aleclarson added a commit that referenced this pull request Jan 26, 2025
@aleclarson
Copy link
Member Author

This PR has been released in radashi@next.

pnpm add radashi@next -E

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BREAKING CHANGE Not backwards compatible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Challenging the Logic Behind "active" in Debounce Function Fix debounce cancel
2 participants